<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .div {
        width: 100px;
        height: 40px;
        line-height: 40px;
        background:#162e48;
        color: #fff;
        padding: 5px 15px;
        text-align: center;
        position: relative;
        border: 1px solid red;
        margin-bottom: 30px;
    }
    .div:before {
        content: ' ';
        border: solid transparent;
        position: absolute;
        border-width: 15px;
        border-top-color: red;
        border-right-color: red;
        right: 0px;
        top: 0px;
    }
    /* .div:after {
        content: ' ';
        border: solid transparent;
        position: absolute;
        border-width: 15px;
        border-top-color: #000;
        border-right-color: #000;
        top: -1px;
        right: -1px;
    } */
  </style>
</head>
<body>
  <div class="div">标题部分</div>
</body>
</html>